<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>理赔柱状图</title>
    <script src="/static/plugins/echarts/echarts.min.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById("main"));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: "理赔报表",
            subtext: "${groupType}",
            left: "center"
        },
        tooltip: {
            trigger: 'axis'
        },
        toolbox: {
            show: true,
            feature: {
                dataView: {show: true, readOnly: true},
                magicType: {show: true, type: ["line", "bar"]},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        legend: {
            data: ["理赔总额"],
            left: "left"
        },
        xAxis: {
            data: ${x}
        },
        yAxis: {},
        series: [{
            name: "理赔总额",
            type: "bar",
            data: ${y},
            markLine: {
                data: [
                    {type: 'average', name: '平均值'}
                ]
            }
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
</html>
